#ifndef XGE_XKILLABLE_TASK_H_
#define XGE_XKILLABLE_TASK_H_
#include "xge_common_config.h"
#include "xtask.h"
#include "xsmart_ptr.h"
#include "xstring.h"

namespace xge{

  using xge_internal::Task;
  // a killable task is a kind of task that can be delete 
  // when it is waiting 
  // so it must run in a single queue worker queue
  // that means the queue must be locked while fetch and enqueue
  // so it will cause little performance hazard , however , that
  // does not mean it is not useful 
  // It can be used for the rasterization of TTF ( detail in the documentation )

  class KillableTask : public Task{
  public:
    // ctor 
    KillableTask( int task_type ,const String& name ) : 
        Task(Task::DOWNCAST_KILLABLE_TASK,task_type) , name_(name) {}
    // return the name of this class
    const String& name() const {
      return name_;
    }
  private:
    // the name of this task 
    String name_ ;
  };


}// namespace xge

#endif// XGE_XKILLABLE_TASK_H_